<?php

include("classes/include.php");

session_start();

if(isset($_SESSION['utilisateur']))
{
	
	if(isset($_POST['prof_nom']) && isset($_POST['prof_prenom']))
	{
		$nomProf = $_POST['prof_nom'];
		$prenomProf = $_POST['prof_prenom'];
		
		$emailProf = "";
		$adresseProf = "";
		
		$matiereProf = "";
		
		if(isset($_POST['prof_email']))
			$emailProf = $_POST['prof_email'];
			
		if(isset($_POST['prof_adresse']))
			$adresseProf = $_POST['prof_adresse'];
			
		if(isset($_POST['prof_matiere']))
			$matiereProf = $_POST['prof_matiere'];

		//$this->creerLoginMdp();
			
		$professeur = new Professeur(-1,$nomProf,$prenomProf,$adresseProf,$emailProf,'','',$matiereProf);

		$professeur->setDroit(2);
		
		$professeur->ajouterProfesseur();
		
	}
	header("Location: administrationProf.php"); 
}

header("Location: administrationProf.php"); 

?>

